System Variables

System variables provide many information that can be used in macro commands.  System variables content is set by program automatically and cannot be changed using a macro command like other variables.

Window Related

 

_vActiveWindow
_vActiveWindow_HWND
_vActiveWindowChild

Title of the currently active window.
HWND of the currently active window.
Title of the currently active child window (dialog box, toolbox, document window).

_vActiveWindowChild_HWND HWND of the currently active child window (dialog box, toolbox, document window).

_vActiveWindowPrev
_vActiveWindowPrev_HWND

Title of the previously active window.
HWND of the previously active window .

_vWinFromMouseCur
_vWinFromMouseCur_HWND

Title of main window with mouse over.
HWND of main window with mouse over

_vChildWinFromMouseCur Title of child window (dialog box, toolbox, document window) with mouse over.
_vChildWinFromMouseCur_HWND HWND of child window (dialog box, toolbox, document window) with mouse over.
_vKeybdFocusWindow Title of the window that is currently receiving keyboard input.
_vKeybdFocusWindow_HWND HWND of the window that is currently receiving keyboard input.

_vWinRectX1, _vWinRectY1,
_vWinRectX2, _vWinRectY2,
_vWinWdt,
_vWinHgt,
_vWinTitle,
_vWinState,
_vWinActive,
_vWinClass 

 Attributes of the window retrieved using <wininfo> command.

 

 

Date & Time Related

 

_vCurrDate_Day

Day of the current date (e.g., 9 if the date is 02/09/2000).

_vCurrDate_DD

Day of the current date in the DD format (e.g., 09)

_vCurrDate_DayName

Name of the day of the current date (e.g., Sunday, Monday, etc.).

_vCurrDate_DayOfWeek

Day of the week (e.g, 1 for Sunday, 2 for Monday, à, 7 for Saturday).

_vCurrDate_Month

Month of the current date (e.g., 02 if the date is 02/19/2000).

_vCurrDate_MM

Month of the current date in the MM format (e.g., 02).

_vCurrDate_Year

Year of the current date (e.g., 2000 if the date is 02/19/2000).

_vCurrDate_YY

Year of the current date in the YY format (e.g., 00).

_vCurrDate_MonthName

Name of the month of the current date (e.g., February if the date is 02/19/2000).

_vCurrDate_DDMMYYYY

Contains current date in DD/MM/YYYY form.

_vCurrDate_MMDDYYYY

Contains current date in MM/DD/YYYY form.

_vCurrTime_Hour12

Contains hour of the current time (e.g., 2 if the current time is 2:15:00 PM).

_vCurrTime_Hour24

Contains hour of the current time (e.g., 14 if the current time is 2:15:00 PM).

_vCurrTime_Minute

Contains minute of the current time (e.g., 15 if the current time is 2:15:00 PM).

_vCurrTime_Second

Contains second of the current time (e.g., 0 if the current time is 2:15 PM).

_vCurrTime_AMPM

Contains PM/AM of the current time (e.g., PM if the current time is 2:15 PM).

_vCurrTime_Total

Contains the number of milliseconds elapsed from the last reboot.

.

 

Files & Folders:

 

_vFolder_AppData

Contains path to the application data folder.

_vFolder_CommonDesktop

Contains path to the all users desktop folder.

_vFolder_CommonPrograms

Contains path to the all users start menu programs folder.

_vFolder_CommonStartMenu  

Contains path to the all users start menu folder.

_vFolder_Cookies

Contains path to the cookies folder.

_vFolder_Desktop

Contains path to the desktop folder.

_vFolder_Favourites

Contains path to the favorites folder.

_vFolder_Personal

Contains path to the personal folder.

_vFolder_Programs

Contains path to the start menu programs folder.

_vFolder_Recent

Contains path to the recent files folder.

_vFolder_SendTo

Contains path to the "send to" folder.

_vFolder_StartMenu

Contains path to the start menu folder.

_vFolder_Startup

Contains path to the start menu start up folder.

_vFolder_Templates

Contains path to the templates folder.

_vFolder_Windows

Contains path to the windows folder.

_vFolder_System

Contains path to the system folder.

_vFolder_Temp

Contains path to the temporary folder.

 

 

Drag & Drop:

The variables described here are only accessible after user drops file(s) on macro toolbar button. (Macro toolbars are only available in MacroToolbar and Macro ToolsWorks products.)  The variables allow to further process (delete, copy, rename, etc.) the file(s) dropped.
 

_vDropFile_FileFullPath

Full path to the file dropped.

_vDropFile_FileName

File name of the file dropped.

_vDropFile_FileDir

Directory of the file dropped.

_vDropFile_Num

The number of files dropped

   

Special Characters

 

_vKeyReturn

'Return' (new line) key (use this key to add a new line to a text in variable).

_vKeyTab

'Tab' key (use this key to add 'tab' to a text in variable).

_vQuoteChar

ô character (use this key to add ô to a text).

_vKeySpace

ôspaceö character

_vKeyPercent

% character

_vKeyBigger

> character

_vKeySmaller

< character

_vKeyBracketL

( character

_vKeyBracketR

) character

   
Mouse & Keyboard Related  

_vLastMouseClick

Contains last mouse click event in the <waitfor> command:
<mlbu> - left button click
<mmbu> - middle button click
<mrbu> - right button click

_vLastKey

Contains last key pressed in the <waitfor> command.

_vMousePosX

Mouse cursor position in the screen coordinates - X.

_vMousePosY

Mouse cursor position in the screen coordinates - Y.

_vIsCapsLockON Is set to YES if CapsLock is on.  Otherwise the variable contains NO.
_vIsNumLockON Is set to YES if NumLock is on.  Otherwise the variable contains NO.
_vIsScrollLockON Is set to YES if ScrollLock is on.  Otherwise the variable contains NO.

.

 

Clippboard Related  

_vClpFormats

Contains comma separated list of formats of data currently saved in clipboard.

_vClpSize

Contains size of clipboard data.

_vClpText

Contains text clipboard data (if currently available). 

.

 

Macro Flow Related

 

_vCanceled The variable is set to 1 if a command (<form_show>, <extmacro>, <listbox>, <varset>, <var_oper>) si canceled  by user.  Otherwise the variable contains 0.

_vLoopCounter

Loop counter (see <begloop> and <endloop> commands). Starts from 1.

_vLoopCounter0

Loop counter (see <begloop> and <endloop> commands). Starts from 0.

_vIsConnectedToInternet

If the computer is connected to the Internet the variable value is equal to YES otherwise it is NO.

_vErr

If an error occurs during macro execution, the error description is saved in this variable.

_vIsExecOnlyCommands

After <cmds> command is executed, this variable content is YES. By default and after <keys> command is executed it is NO.

_vWinStarting

If the program is set to automatically start on windows startup then the _vWinStarting contains "YES" when the program is starting on windows startup.  Otherwise the value is "NO".

_vMacroFileLoaded

Full path to the macro file currently loaded in the program.

_vMacroFileFolder

Folder where the currently loaded macro file resides.  It is ended by \.

_vRunningMacroName

Contains name of the currently running macro.

_vRunningMacroId

Contains Id of the currently running macro.

_vThisProgramVersion

Contains the program version.  The program version provided here is internal and can be different from the version shown in About box.

_vMsgButton

The variable contains YES if "Yes" button was clicked in the <msg> command, otherwise it contains NO.

_vIsMacroEnabled_MACRONAME

 Such system variable exist for each macro.  The variable contains "1" if the macro is enabled, otherwise it is "0".  For example, if the macro name is "MyMacro1" then the associated system variable is "_vIsMacro_Enabled_MyMacro1".

_vIsGroupEnabled_MACRONAME

 Such system variable exist for each macro group.  The variable contains "1" if the macro group is enabled, otherwise it is "0".  For example, if the name of macro group is "FileMacros" then the associated system variable is "_vIsGroupEnabled_MyMacro1".

_vDoesVariableExist_VARIABLE

 Such system variable exist for each variable.  The variable contains "1" if the variable exists, otherwise it is "0".  For example, if the name of a variable is "vMyData" then the associated system variable is "_vDoesVariableExist_vMyData".

   

Other:

 

_vStrEmpty

Empty string (use this variable to assign empty string to a variable).

_vIsScreensaverRunning

YES if screen saver is running.

_vIsScreensaverEnabled

YES if screen saver is enabled.

_vOperatingSystemVersion

Operating system version.

_vScreenWidth

Screen width in pixels.

_vScreenHeight

Screen height in pixels.


Example:
 

<#> This macro shows how to use system variables
<#>
<execappex>("notepad.exe","","",0,0)

Active window title: <varout>("_vActiveWindow",0)
Current mouse position: (<varout>("_vMousePosX",0), <varout>("_vMousePosY",0))

System folders:
<varout>("_vFolder_AppData",0)
<varout>("_vFolder_CommonDesktop",0)
<varout>("_vFolder_CommonPrograms",0)
<varout>("_vFolder_CommonStartMenu",0)
<varout>("_vFolder_Cookies",0)
<varout>("_vFolder_Desktop",0)
<varout>("_vFolder_Favourites",0)
<varout>("_vFolder_Personal",0)
<varout>("_vFolder_Programs",0)
<varout>("_vFolder_Windows",0)
<varout>("_vFolder_System",0)